using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace Baocao
{
    public partial class m_rptTHB_SlDtKho : DevExpress.XtraReports.UI.XtraReport
    {
        public m_rptTHB_SlDtKho()
        {
            InitializeComponent();
            CreateGroup();
        }

        public void CreateGroup()
        {
            GroupField groupField = new GroupField("MaTenKh");
            groupField.SortOrder = XRColumnSortOrder.Descending;
            GroupHeader1.GroupFields.Add(groupField);

            CalculatedField cl = new CalculatedField();            
            CalculatedFields.Add(cl);            
            cl.DataSource = this.DataSource;
            cl.DataMember = this.DataMember;            
            cl.FieldType = FieldType.String;            
            cl.Name = "MaTenKh";            
            cl.Expression = "TRIM([Ma_kho])+' - '+ TRIM([Ten_kho])";
            
            MaTenKh.DataBindings.Add("Text", this.DataSource, "MaTenKh");
            GroupHeader1.Controls.Add(MaTenKh);
        }

    }
}
